<!-- 我的详细资料页面:  ty -->

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">            <!-- 引入thymeleaf约束 -->
<html>
<head lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <title>我的详情</title>
     <link type="text/css" rel="stylesheet"  href="css/info.css">
	<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
	<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    
    <link type="text/css" rel="stylesheet" href="css/mall.css"/>
   
</head>
<body class="body_color">
<div id="child_header">
    <div class="goback"><a href="/chat/personcenter"><i></i></a></div>
    <div class="current_location"><span>个人信息</span></div>
    <div class="next_operate"><a onclick="updateInfo()"><span>保存</span></a></div>
</div>
<div class="user_info">
    <ul>
        <li><span>头像</span><img data-toggle="modal" data-target="#systemimg" class="info_img1" src="avatar/1.jpg" th:src="@{./{filename}(filename=${user.user_headimg})}"></li>
        <li><span>昵称</span><input id="nickname" class="info_input" type="text" th:value="${user.user_nickname}"></li>
        <li><span>性别</span><input id="sex" class="info_input" type="text" th:value="${user.user_sex}"></li>
        <li><span>年龄</span><input id="age" class="info_input" type="text" th:value="${user.user_age}"></li>
        <li><span>姓名</span><input id="name" class="info_input" type="text" th:value="${user.user_name}"></li>
        <li><span>QQ</span><input id="qq" class="info_input" type="text" th:value="${user.qq}"></li>
        <li><span>微信</span><input id="wechat" class="info_input" type="text" th:value="${user.user_wechat}"></li>
        <li><span>邮箱</span><input id="email" class="info_input" type="text" th:value="${user.user_email}"></li>
        <li><span>地址</span><input id="adress" class="info_input" type="text" th:value="${user.adress}"></li>   
        <li><span>公开资料： &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp</span><input  name="public"  type="radio" value="0">私密 &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
        								<input  name="public" type="radio" value="1" >好友&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
        								<input  name="public" type="radio" value="2" >所有人</li>      
    
    </ul>
    
    
    
    <div class="modal fade" id="systemimg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="myModalLabel">
					更换头像
				</h4>
			</div>
			<div  th:each="aaa : ${imgs}">
				<span><img src="avatar/1.jpg" th:src="@{./{filename}(filename=${aaa.img})}" width="10%" style="float:left;" th:onclick="'javascript:updateimg(\''+${aaa.img_id}+'\',0);'"></span>
			
			</div>
			
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
    
    
    
    
    
    <script src="js/jquery.min.js"></script>
    <script type="text/javascript">
  
    
    function updateimg(id){
    	$.ajax({
    		url:"/chat/updateimg",
    		data:{
    			"imgid":id},
    		success:function(result){
				window.location.href="/chat/user_info";
			}  
    	})
    }
    
  
    function updateInfo(){
    	
    	$.ajax({
    		url:"/chat/updateInfo",
    		data:{
    			"nickname":$("#nickname").val(),
    			"sex":$("#sex").val(),
    			"age":$("#age").val(),
    			"name":$("#name").val(),
    			"adress":$("#adress").val(),
    			"wechat":$("#wechat").val(), 
    			"email":$("#email").val(), 
    			"qq":$("#qq").val(),
    			"user_privacy":$("input[name='public']:checked").val()
    		},
    		success:function(result){
    			window.location.href="/chat/personcenter";
    		}    			
    	})	    	
    }
    
    
    </script >
    

    
    
</div>
</body>
</html>